<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/view/include/taglib.jsp"%>
<html>
<head>
    <title>收件箱</title>
    <%@ include file="../../include/head.jsp"%>
</head>
<body>
<div class="admin-content">
    <div class="admin-content-body">
        <div class="am-g ui-tools">
            <div class="am-u-sm-12 am-u-md-6">
                <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                        <button type="button" class="am-btn am-btn-default" onclick="openModel('新增收件箱','${ctx}/mailbox/mailReceive/create')">
                            <span class="am-icon-plus"></span> 新增收件箱
                        </button>
                    </div>
                </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
                <form id="searchForm" action="${ctx}/mailbox/mailReceive" method="post">
                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

                    <div class="am-input-group am-input-group-sm">
                        <input type="text" class="am-form-field" name="key" value="${page.key}" placeholder="">
                        <span class="am-input-group-btn">
                            <button class="am-btn am-btn-default" type="submit">搜索</button>
                        </span>
                    </div>
                </form>
            </div>
        </div>
        <div class="am-g">
            <div class="am-u-sm-12">
                <form class="am-form">
                    <table id="contentTable" class="am-table am-table-striped am-table-hover table-main">
                        <thead>
                        <tr>
                                <th>序号</th>
                                <th>邮件编号</th>
                                <th>收件人</th>
                                <th>阅读时间</th>
                                <th>状态 是否阅读</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="mailReceive" varStatus="status">
                            <tr>
                                    <td>${mailReceive.id}</td>
                                    <td>${mailReceive.mailId}</td>
                                    <td>${mailReceive.receiver}</td>
                                    <td><fmt:formatDate value="${mailReceive.updateDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                                    <td>${mailReceive.status}</td>
                                <td>
                                    <a href="javascript:;" onclick="openModel('修改收件箱','${ctx}/mailbox/mailReceive/update?id=${mailReceive.id}')">修改</a>
                                    <a href="${ctx}/mailbox/mailReceive/${mailReceive.id}/delete?pageNo=${page.pageNo}&pageSize=${page.pageSize}" onclick="return confirm('确认要删除该条数据吗？', this.href)">删除</a></td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </form>
                <%@ include file="../../utils/pagination.jsp"%>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var msg = '${msg}';
        if(msg!=''){
            showMsg(msg);
        }
    });
</script>
</body>
</html>
